An inode is a data structure used to store information, such as metadata, about a file. Data blocks are structures used to store the actual data for the file. Inodes and data blocks are typically stored in disk storage as tree-like data structures. A storage operating system controls access to the inodes and data blocks by managing the multiple concurrent read and write operations on the inodes and data blocks. The storage operating system implements a locking mechanism to support the write operations. The locking mechanism ensures the data integrity of the inodes and data blocks by locking access to an inode or data block while the inode or data block is undergoing a write operation. The locking mechanism unlocks access to the inode or data block when the write operation is complete.
The cost of locking data structures such as inodes and data blocks is high due to swapping between the user space and kernel space, and due to the cost associated with kernel locking. The user space is the space in virtual memory where all user mode applications work, while the kernel space is the space in virtual memory strictly reserved for running the kernel, kernel extensions and some device drivers. Most locking algorithms do not provide parallelism between write operations and read operations of a data structure, even though the operations may access different parts of the data structure. Instead, the locking algorithms lock the entire data structure whenever a write is performed on any part of the data structure, thereby preventing any concurrent read operations from occurring on the parts of the data structure unaffected by the write operation.